package com.qf.mvc2202.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qf.mvc2202.utils.MyJsonSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
//    @JsonProperty("userid")
    @JsonIgnore
    private Integer id;
    private String name;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date birth;
    private Boolean gender;

//    @JsonInclude(JsonInclude.Include.NON_NULL)
//    @JsonInclude(value= JsonInclude.Include.NON_EMPTY)
    private String[] hobby;

    @JsonSerialize(using = MyJsonSerializer.class)
    private Double salary = 10000.126;
}
